package com.supermap.business.temp;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dataservice.util.Table;
import com.supermap.dubbo.api.temp.TempExpertNMService;
import com.supermap.dubbo.api.temp.TempUserNMService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author:langhongshuai
 * @Description:临时内蒙专家用户接口表
 * @Date:18/8/10 上午10:46
 */
@Controller
@RequestMapping("TempExpertNMController")
public class TempExpertNMController {

    /**
     * 使用指定类初始化日志对象，在日志输出的时候，可以打印出日志信息所在类
     */
    protected static final Logger logger = LoggerFactory.getLogger(TempExpertNMController.class);

    @Reference
    private TempExpertNMService tempExpertNMService;


    /**
     *
     * 获取所有的专家信息
     * @param table
     * @return
     */
    @RequestMapping("getExpertInfoByAreaname")
    @ResponseBody
    public JSONUtil getExpertInfoByAreaname(HttpServletRequest request, Table table){
        String areaname =request.getParameter("areaname");
        return tempExpertNMService.getExpertInfoByAreaname(areaname,table);
    }

    /**
     * 通过区域名获取区域专家数总数
     * @param areaname
     * @return
     */
    @RequestMapping("getExpertInfoCountByAreaname")
    @ResponseBody
    public JSONUtil getExpertInfoCountByAreaname(String areaname){
        return tempExpertNMService.getExpertInfoCountByAreaname(areaname);
    }
}
